package com.cy.dda.model;

import com.github.pagehelper.PageHelper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;


/**
 * @description: 翻页
 * @author: Ocean
 * @create: 2018-06-14 09:10
 **/
@Data
@ApiModel("分页")
public class Page {

    @ApiModelProperty(value = "页码", example = "1")
    private Integer page = 1;

    @ApiModelProperty(value = "每页数量", example = "10")
    private Integer limit = 10;

    /**
     * 翻页，统计行数
     */
    public void startPage() {
        PageHelper.startPage(page, limit, false);
    }

    /**
     * 翻页，不统计行数
     */
    public void startPageWitCount() {
        PageHelper.startPage(page, limit, true);
    }
}
